<!DOCTYPE html>
<html>
<head>
	<script>
function check()
    {
      var username=sessionStorage.key(sessionStorage.length);
         if(sessionStorage.length==0)
     {
       alert("非法访问！");
         
      window.location.href='http://buptjiajing.gitee.io/buptsice_training_2017_2/用户注册2.0.html'
    
       
     }


           else { var list = document.getElementById("okname"); 
               list.innerHTML =sessionStorage.getItem("username");
         loadAll();
       }
    }


        function loadAll(){  
        var list = document.getElementById("list");  
        if(localStorage.length>0){  
            var result = "<table border='1'>";  
            result += "<tr><td>用户名</td><td>密码</td><td>邮箱</td><td>注册时间</td></tr>";  
            for(var i=0;i<localStorage.length;i++)
      {  
                var sitename = localStorage.key(i);  
                var str = localStorage.getItem(sitename); 
        var site = JSON.parse(str);
                result += "<tr><td>"+sitename+"</td><td>"+site.siteurl+"</td><td>"+site.sitename+"</td><td>"+site.nowtime+"</td></tr>";  
            }  
            result += "</table>";  
            list.innerHTML = result;  
        }else{  
            list.innerHTML = "数据为空……";  
        }  
    }      
    </script>
    
	<style>
	h1
	{text-align: center}
	body
		{background-color:#b0c4de;}
    </style>
	<meta charset="utf-8">
	<title>登陆成功</title>
	<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">  
	
</head>
<body>
	<div class="page-header">
    <h1>风流之家
    	<small>Fengliu<small>
    	</h1>
</div>
<div class="container">
	<div class="jumbotron">
		<h1>登陆成功!</h1>
		<p style="text-align: center">欢迎回来!</p>
	</div>
	<button onclick="javascript:window.location.href='http://buptjiajing.gitee.io/用户登录2.0.html'"type="button" class="btn btn-primary">返回</button>

</div>
<script>check()</script>
 &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; 
  <font size="6" color="red"><b id="okname"> </b> </font>
   &nbsp;&nbsp;
  <div id="list"> </div>


</body>
</html>